<?php
	//计算当天到此时的人流量
	
	//设置时区
	ini_set('date.timezone','Asia/Shanghai');
    $conn = new mysqli("localhost:3306","root","lc971019");
	if($conn->connect_error)
	{
		die('Could not connect:'.$conn->connect_error());
	}
	
	//从上午8点开始计算
	$time_start = date("Y-m-d",intval(time()))." 08:00:00";
	//现在的时间
	$time_end = date("Y-m-d H:i:s",intval(time()));
	
	$sql = "select count(distinct mac) from wifidata where times > ".time_start." and times <= ".time_end.";";
	
	$result_fp_all = $conn->query($sql);
	
	$all=0;
	
	if($result_fp_all->num_rows > 0){
		if($row = $result_fp_all->fetch_assoc()){
			$all=$row["count(distinct mac)"];
			}
		}
?>